import React, {Component} from 'react';
import {Route, Switch, Redirect} from "react-router-dom"
import MyNavLick from "../../components/MyNavLick";
import News from "./News";
import Message from "./Message";

class Home extends Component {
  render() {
    return (
      <div>
        <h3>我是Home的内容</h3>
        <ul className="nav nav-tabs">
          <li>
            <MyNavLick className="list-group-item" to="/home/news">News</MyNavLick>
          </li>
          <li>
            <MyNavLick className="list-group-item" to="/home/message">Message</MyNavLick>
          </li>
        </ul>
        {/* 注册路由 */}
         <Switch>
           <Route path="/home/news" component={News}/>
           <Route path="/home/message" component={Message}/>
           <Redirect to="/home/news"/>
         </Switch>
      </div>
    );
  }
}

export default Home;